<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改会员管理')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-customer-edit" th:object="${aCustomer}">
        <input name="id" th:field="*{id}" type="hidden">
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">会员卡号：</label>
                <div class="col-sm-8">
                    <input name="customerCard" th:field="*{customerCard}" class="form-control" type="text" required>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">用户：</label>
                <div class="col-sm-8">
                    <select name="userId" id="userId" class="form-control" required>
                        <!-- 商品选项将通过 JavaScript 动态填充 -->
                        <option th:each="user:${users}" th:value="${user.userId}" th:text="${user.userName}"
                                th:selected="${user.userId == aCustomer.userId}"></option>
                    </select>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">客户电话：</label>
                <div class="col-sm-8">
                    <input name="customerPhone" th:field="*{customerPhone}" class="form-control" type="text" required>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">状态：</label>
                <div class="col-sm-8">
                    <select name="status" th:field="*{status}" class="form-control">
                        <option value="0">启用</option>
                        <option value="1">冻结</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">客户预留名称：</label>
                <div class="col-sm-8">
                    <input name="customerName" th:field="*{customerName}" class="form-control" type="text" required>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">余额：</label>
                <div class="col-sm-8">
                    <input name="balance" th:field="*{balance}" class="form-control" type="text" required>
                </div>
            </div>
        </div>
<!--        <div class="col-xs-12">-->
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label">积分：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="socre" th:field="*{socre}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--        </div>-->
    </form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "system/customer";
    $("#form-customer-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-customer-edit').serialize());
        }
    }
</script>
</body>
</html>